import request from '@/utils/request'

// 列表查询
export function listManagement(query) {
  return request({
    url: '/system/bills/list',
    method: 'get',
    params: query
  })
}
// 项目分类列表查询
export function listtypeManagement(query) {
  return request({
    url: '/system/management/list',
    method: 'get',
    params: query
  })
}
// 成本科目列表查询
export function listSub(query) {
  return request({
    url: '/system/list/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getManagement(dataId) {
  return request({
    url: `/system/bills/${dataId}`,
    method: 'get',
  })
}

// 新增
export function addManagement(data) {
  return request({
    url: '/system/bills',
    method: 'post',
    data: data
  })
}

// 修改
export function updateManagement(data) {
  return request({
    url: '/system/bills',
    method: 'put',
    data: data
  })
}

// 删除
export function delManagement(dataId) {
  return request({
    url: '/system/bills/' + dataId,
    method: 'delete'
  })
}

// 查询部门下拉树结构
export function deptTreeSelect() {
  return request({
    url: '/system/user/deptTree',
    method: 'get'
  })
}

//查询二级部门
export function listTwoDept(query) {
  return request({
    url: '/system/info',
    method: 'get',
    params: query
  })
}

//查询付款单位
export function listPaydept(query) {
  return request({
    url: '/system/paymentdept/list',
    method: 'get',
    params: query
  })
}